/*    */ package com.zimbra.cs.account.ldap.upgrade;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Pair;
/*    */ import com.zimbra.common.util.StringUtil;
/*    */ import com.zimbra.cs.account.Config;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import java.util.LinkedHashMap;
/*    */ import java.util.Map;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BUG_88098
/*    */   extends UpgradeOp
/*    */ {
/*    */   void doUpgrade()
/*    */     throws ServiceException
/*    */   {
/* 33 */     upgradeZimbraGalLdapFilterDef();
/*    */   }
/*    */   
/*    */   private void upgradeZimbraGalLdapFilterDef() throws ServiceException
/*    */   {
/* 38 */     Config config = this.prov.getConfig();
/*    */     
/* 40 */     Pair<String, String> value = new Pair("zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)(objectclass=zimbraGroup))(!(objectclass=zimbraCalendarResource)))", "zimbraAccountAutoComplete:(&(|(displayName=*%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)(objectclass=zimbraGroup))(!(objectclass=zimbraCalendarResource)))");
/*    */     
/*    */ 
/*    */ 
/*    */ 
/* 45 */     Set<String> curValues = config.getMultiAttrSet("zimbraGalLdapFilterDef");
/*    */     
/* 47 */     Map<String, Object> attrs = new LinkedHashMap();
/* 48 */     String oldValue = (String)value.getFirst();
/* 49 */     String newValue = (String)value.getSecond();
/*    */     
/* 51 */     if (curValues.contains(oldValue)) {
/* 52 */       StringUtil.addToMultiMap(attrs, "-zimbraGalLdapFilterDef", oldValue);
/* 53 */       StringUtil.addToMultiMap(attrs, "+zimbraGalLdapFilterDef", newValue);
/*    */     }
/* 55 */     modifyAttrs(config, attrs);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/upgrade/BUG_88098.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */